<#include "license.ftl">
<@license/>
package ${doc.all.package}.gwt.mvp.util;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import redora.client.mvp.PlaceController;
import redora.client.mvp.ClientFactory;
import redora.client.mvp.Locator;
import ${doc.all.package}.gwt.mvp.service.LocatorImpl;


public class ClientFactoryImpl implements ClientFactory {

    static final EventBus eventBus = new SimpleEventBus();
    static final PlaceController placeController = new PlaceController(eventBus);
    static Locator locator;

    @Override
    public EventBus getEventBus() {
        return eventBus;
    }

    @Override
    public PlaceController getPlaceController() {
        return placeController;
    }

    @Override
    public Locator getLocator() {
        if (locator == null) {
            locator = new LocatorImpl(this);
        }
        return locator;
    }
}
